New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8255216: Change _directive->BreakAtCompileOption to env()->break_at_compile() #1806
Conversation
Hi @danlemmond, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user danlemmond" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
@danlemmond The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
/covered |
Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated! |
@@ -2224,7 +2223,6 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { | |||
DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, compiler_name(task_level)); | |||
} | |||
|
|||
should_break = directive->BreakAtExecuteOption || task->check_break_at_flags(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CompileTask::check_break_at_flags is dead code too, and CIBreakAtOSR, CIBreakAt
they are all defunct right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure whether or not we wanted to roll the removal of all dead code into this issue or just _break_at_compile. The JBS issue specifically mentions _break_at_compile so that's what I removed here - can expand to do other stuff if you think it's a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to remove all that dead code with this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should CIBreakAtOSR and CIBreakAt be removed too, or is it a bug that these flags are ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fact that these flags are not working proves that no one is using them and therefore they should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally it was used to break into debugger during compilation:
http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/fffb29a53519/src/share/vm/opto/compile.cpp#l2104
In JDK 9 it was replaced with Compiler directive which skips compilation's ciEnv and consult CompilerOracle directly:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/compile.cpp#L2099
So I think cleaning ciEnv is fine.
I think it is bug that task->check_break_at_flags() is ignored. I used CIBreakAtOSR and CIBreakAt during debugging long ago before directives were introduced. I think it should be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fact that these flags are not working proves that no one is using them and therefore they should be removed.
I tried to use BreakAtExecute recently, thinking it would generate a break in the generated code, but it didn't work, so I ended up using "break", which if I recall also sets a breakpoint when the method is compiled. I like having the choice of "break during compile" vs "break in generated code".
Please send an e-mail to dalibor.topic@oracle.com so that I can mark your account as verified. |
Webrevs
|
@@ -2224,7 +2223,6 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { | |||
DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, compiler_name(task_level)); | |||
} | |||
|
|||
should_break = directive->BreakAtExecuteOption || task->check_break_at_flags(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally it was used to break into debugger during compilation:
http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/fffb29a53519/src/share/vm/opto/compile.cpp#l2104
In JDK 9 it was replaced with Compiler directive which skips compilation's ciEnv and consult CompilerOracle directly:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/compile.cpp#L2099
So I think cleaning ciEnv is fine.
I think it is bug that task->check_break_at_flags() is ignored. I used CIBreakAtOSR and CIBreakAt during debugging long ago before directives were introduced. I think it should be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify about my comment about task->check_break_at_flags(). The easier fix I think is instead of removing ciEnv code use env()->break_at_compile() in compile.cpp instead of directive->BreakAtCompileOption
bbbda14
to
efbd3e4
Compare
_break_at_compile is no longer in use and can be safely removed. No new code, and Tier1 tests succeed after code is removed. Bug: https://bugs.openjdk.java.net/browse/JDK-8255216
efbd3e4
to
990634b
Compare
Move to env()->break_at_compile() in compile.cpp
990634b
to
36bc753
Compare
This reverts commit 4b783cc.
@danlemmond , I understand Kozlov's comment. your change 36bc753 covers c2's optimization. There are another 2 places refer to _directive->BreakAtCompileOption. I think you need to change them to env()-> break_at_compile as well. https://github.com/openjdk/jdk/blob/master/src/hotspot/share/c1/c1_Compilation.cpp#L449 |
Yes, these places should be fixed too. |
I would also suggest to change RFE (and this PR) Subject and Description if you do that. |
Repurpose to env()->break_at_compile()
Currently ciEnv->break_at_compile() is set if directive->BreakAtExecuteOption || task->check_break_at_flags(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good.
|
@danlemmond This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 233 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@vnkozlov, @phohensee) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Okay. This is totally messed up :( BreakAtExecuteOption should be only used in https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/output.cpp#L376 Pointed compileBroker.cpp#L2226 line should use BreakAtCompileOption instead of BreakAtExecuteOption. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need additional change in compileBroker.cpp
BreakAtExecuteOption should not be used here, instead use BreakAtCompileOption
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good. Finally.
/integrate |
@danlemmond |
/sponsor |
@phohensee @danlemmond Since your change was applied there have been 233 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 7be9113. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
_break_at_compile was no longer in use after changes to compile.cpp.
Change compile.cpp and c1_Compilation.cpp to use env()->break_at_compile() instead
to make that code no longer dead.
No new code, and Tier1 tests succeed after code is removed.
Bug: https://bugs.openjdk.java.net/browse/JDK-8255216
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1806/head:pull/1806
$ git checkout pull/1806